/*
 * @Descripttion:
 * @version:
 * @Author: spring
 * @Date: 2022-04-17 18:19:43
 * @LastEditors: spring
 * @LastEditTime: 2022-04-18 14:25:56
 */
import { memo, useState } from "react";
import { Popover, Table } from "antd";
import { archiverType } from "../../../../types";
import { column } from "./config";
import AntdTable from "../../../../components/Table";

export default memo(function ArchivesPopover(props: { tags: archiverType }) {
  let [undergoState, undergoStateState] = useState(false);

  return (
    <Popover
      placement="bottomLeft"
      trigger="click"
      arrowPointAtCenter
      onVisibleChange={(br) => {
        undergoStateState(br);
      }}
      content={
        <AntdTable
          tableConfig={{
            dataSource: props.tags.undergo,
            style: { width: 500 },
          }}
          configColumn={{ column }}
        ></AntdTable>
      }
    >
      <span style={{ cursor: "pointer" }}>{undergoState ? "-" : "+"}</span>
    </Popover>
  );
});
